﻿using System;
using System.Collections.Generic;
using System.Text;

namespace HZ.Common
{
    public static class ThrowHelper
    {
        /// <summary>
        /// 抛出指定异常
        /// </summary>
        /// <param name="condition">false抛出异常</param>
        /// <param name="msg">自定义提示信息</param>
        public static void Throw(bool condition, string msg)
        {
            if (!condition)
            {
#if DEBUG
                throw new ArgumentException(msg);
#endif
            }
        }
        /// <summary>
        /// 抛出默认异常
        /// </summary>
        /// <param name="condition">false抛出异常</param>
        public static void Throw(bool condition)
        {
            Throw(condition, "调用出现错误，请检查调用参数！");
        }
    }
}
